package com.zjitc.book.service.impl;

import com.zjitc.book.entity.Book;
import com.zjitc.book.mapper.BookMapper;
import com.zjitc.book.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookMapper bookMapper;
    @Override
    public List<Book> getBooks() {
        return bookMapper.getBooks();
    }

    @Override
    public Book getBookById(Long id) {
        return bookMapper.getBookById(id);
    }

    @Override
    public List<Book> searchBooksByCon(Book book) {
        return bookMapper.searchBooksByCon(book);
    }

    @Override
    public void UpdateBook(Book book) {
        bookMapper.UpdateBook(book);
    }
    @Override
    public void deleteBookById(int id) {
        bookMapper.deleteBookById(id);
    }

    @Override
    public void addBook(Book book) {
        bookMapper.addBook(book);
    }

}
